   ****************************************************************
   ***                                                          ***
   ***  This file contains the code to generate all tables in   ***
   ***  Nooruddin & Simmons, "Do voters count? Institutions,    ***
   ***  voter turnout, and public goods provision in India."    ***
   ***  Electoral Studies, vol. 37, no. 1, pp. 1-14.            ***
   ***															***
   ****************************************************************



*******************************************
*******************************************
*******************************************// REPLICATE TABLES
*******************************************
*******************************************



***************************************************************************
// REPLICATION OF TABLE 1
***************************************************************************
// Models in Table 2 use the Data_IndiaElectionYr_Stata10.dta database
clear
use "Data_IndiaElectionYr_Stata10.dta" 

// Model 1: Effect of fragmentation and voter turnout on DEVELOPMENT spending
// Store estimates
xtpcse devexp_share_totexp2  enop_seats turnoutlag ix_enopturnout   growth_new log_realinc_new right coalition post1991 f1-f15 ,  pa noconstant
estimates store eldevexp

// Model 2:  Effect of fragmetation and voter turnout on EDUCATION spending
// Store estimates
xtpcse educat_share_totexp2 enop_seats turnoutlag ix_enopturnout  growth_new log_realinc_new right coalition post1991  f1-f15 ,  pa noconstant
estimates store eleducat

// Model 3: Effect of fragmentation and voter turnout on CIVIL ADMINISTRATION spending
// Store results
xtpcse civiladm_share_totexp2 enop_seats turnoutlag ix_enopturnout   growth_new log_realinc_new right coalition post1991 f1-f15 ,  pa noconstant
estimates store elciviladm

***************************************************************************
// REPLICATION OF  TABLE 2
***************************************************************************
// Models 4 - 6 in Table 2 use the Data_IndiaAnnual_Stata10.dta database
clear
use "Data_IndiaElectionYr_Stata10.dta"

// Model 4: Fragmentation and turnout on DEVELOPMENT spending WITH FULL CONTROLS
xtpcse devexp_share_totexp2 enop_seats turnoutlag ix_enopturnout  log_realinc_new growth_new right coalition post1991 windiff incomtaxshare grantsrevshare loansrevshare f1-f15, pa noconstant
estimates store eldevexp_full

// Model 5: Fragmentation and turnout on EDUCATION spending WITH FULL CONTROLS
xtpcse educat_share_totexp2 enop_seats turnoutlag ix_enopturnout  log_realinc_new growth_new right coalition post1991 windiff incomtaxshare grantsrevshare loansrevshare f1-f15, pa noconstant
estimates store eleducat_full

// Model 6: Fragmentation and turnout on CIVIL ADMINISTRATION spending WITH FULL CONTROLS
xtpcse civiladm_share_totexp2 enop_seats turnoutlag ix_enopturnout   log_realinc_new growth_new right coalition post1991 windiff incomtaxshare grantsrevshare loansrevshare f1-f15, pa noconstant
estimates store elciviladm_full

// Models 7 - 9 in Table 2 use the Data_IndiaAnnual_Stata10.dta database
clear 
use "Data_IndiaAnnual_Stata10.dta"

// Model 7: Fragmentation and turnout on DEVELOPMENT spending in dynamic model with annual data
xtpcse devexp_share_totexp2  enop_seatslag turnoutconslag ix_turnoutenop_seatslag  devexp_share_totexp2lag   growth_newlag log_realinc_newlag rightconslag coalitionlag post1991     f1-f15,  pa  noconstant
estimates store andevexp

// Model 8: Fragmentation and turnout on EDUCATION spending in dynamic model with annual data
xtpcse educat_share_totexp2  enop_seatslag turnoutconslag ix_turnoutenop_seatslag  educat_share_totexp2lag   growth_newlag log_realinc_newlag rightconslag coalitionlag post1991   f1-f15 if state!="",  pa noconstant
estimates store aneducat

// Model 9: Fragmentation and turnout on CIVIL ADMINISTRATION spending in dynamic model with annual data
xtpcse civiladm_share_totexp2  enop_seatslag turnoutconslag ix_turnoutenop_seatslag  civiladm_share_totexp2lag   growth_newlag log_realinc_newlag rightconslag coalitionlag post1991    f1-f15,  pa noconstant 
estimates store anciviladm

*******************************************
*******************************************
*******************************************// REPLICATE FIGURES
*******************************************
*******************************************

// Figure 1: Effective number of electoral parties in India
// Graph uses the ENEP_India_Stata10.dta database
clear
use "ENEP_India_Stata10.dta"
tsline enep, graphregion(color(white)) scheme(s2mono) 

// Figure 2 Panel A: Party Fragmentation in the Indian states (uses annual data base)
clear 
use "Data_IndiaAnnual_Stata10.dta"
tsline enop_votes, by(state, graphregion(color(white))) xtitle(Year) ytitle(Effective Number of Electoral Parties) scheme(s2mono)

// Figure 2 Panel B: Voter turnout in Indian states (uses election year data)
clear 
use "Data_IndiaElectionYr_Stata10.dta"
tsline turnout, by(state, graphregion(color(white))) xtitle(Year) ytitle(Voter Turnout) scheme(s2mono)

// Figure 3: Party fragmentation and incumbent seat share (uses annual data)
clear
use "Data_IndiaAnnual_Stata10.dta"
graph twoway (scatter incumbentseatshare enop_votes) (lfit incumbentseatshare enop_votes), graphregion(color(white)) xtitle(Effective Number of Electoral Parties) ytitle(Largest Government Party Seat Share) scheme(s2mono) legend(off)

// Figure 4 Panel A:  (uses election year data)
clear
use "Data_IndiaElectionYr_Stata10.dta"

graph twoway (scatter devexp_share_totexp2 enop_seats if turnout<=63.6, m(oh) mcolor(black))(lfit devexp_share_totexp2 enop_seats if turnout<=63.6, lcolor(black) lpattern(solid))(scatter devexp_share_totexp2 enop_seats if turnout>63.6 , m(diamond) mcolor(gray))(lfit devexp_share_totexp2 enop_seats if turnout>63.6 , lcolor(gray) lpattern(dash)), graphregion(color(white))  xtitle(Effective Number of Legislative Parties) ytitle(Development Expenditures (% Total Spending) ) legend(row(1) label(1 "Low Turnout") label(3 "High Turnout") order(1 3)) title(Panel A, color(black))

// Figure 4 Panel B:
graph twoway (scatter civiladm_share_totexp2 enop_seats if turnout<=63.6, m(oh) mcolor(black))(lfit civiladm_share_totexp2 enop_seats if turnout<=63.6, lcolor(black) lpattern(solid))(scatter civiladm_share_totexp2 enop_seats if turnout>63.6 , m(diamond) mcolor(gray))(lfit civiladm_share_totexp2 enop_seats if turnout>63.6 , lcolor(gray) lpattern(dash)), graphregion(color(white))  xtitle(Effective Number of Legislative Parties) ytitle(Civil Spending Expenditures (% Total Spending) ) legend(row(1) label(1 "Low Turnout") label(3 "High Turnout") order(1 3)) title(Panel B, color(black))

// Figure 4: Panel C
graph twoway (scatter devexp_share_totexp2 turnoutlag if enop_seats>2.4, m(oh) mcolor(black))(lfit devexp_share_totexp2 turnoutlag if enop_seats>2.4, lcolor(black) lpattern(solid))(scatter devexp_share_totexp2 turnoutlag if enop_seats<=2.4, m(diamond) mcolor(gray))(lfit devexp_share_totexp2 turnoutlag if enop_seats<=2.4, lcolor(gray) lpattern(dash)), graphregion(color(white))  xtitle(Voter Turnout) ytitle(Development Expenditures (% Total Spending) ) legend(row(1) label(1 "High Fragmentation") label(3 "Low Fragmentation") order(1 3)) title(Panel C, color(black))

// Figure 4: Panel D
graph twoway (scatter civiladm_share_totexp2 turnoutlag if enop_seats>2.4, m(oh) mcolor(black))(lfit civiladm_share_totexp2 turnoutlag if enop_seats>2.4, lcolor(black) lpattern(solid))(scatter civiladm_share_totexp2 turnoutlag if enop_seats<=2.4, m(diamond) mcolor(gray))(lfit civiladm_share_totexp2 turnoutlag if enop_seats<=2.4, lcolor(gray) lpattern(dash)), graphregion(color(white))  xtitle(Voter Turnout) ytitle(Civil Spending Expenditures (% Total Spending) ) legend(row(1) label(1 "High Fragmentation") label(3 "Low Fragmentation") order(1 3)) title(Panel D, color(black))

// Figure 5 Panel 1: Marginal effect of fragmentation on DEVELOPMENT spending as turnout changes (results use election year data)
clear
use "Data_IndiaElectionYr_Stata10.dta"
estimates dir // Check to see if results named eldevexp, eleducat, elciviladm are available.  If so, proceed below.  If not, re-estimate the models in Table 1.

estimates restore eldevexp
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 5 Panel 2: Marginal effect of fragmentation on EDUCATION spending as turnout changes
estimates restore eleducat
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 5 Panel 3: Marginal effect of fragmentation on CIVIL ADMINISTRATION spending as turnout changes
estimates restore elciviladm
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 5 Panel 4: Marginal effect of turnout on DEVELOPMENT spending as fragmentation changes
estimates restore eldevexp
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1.5&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 5 Panel 5: Marginal effect of turnout on EDUCATION spending as fragmentation changes
estimates restore eleducat
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1.5&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 5 Panel 6:  Marginal effect of turnout on CIVIL ADMINISTRATION spending as fragmentation changes
estimates restore elciviladm
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1.5&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1.5&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6: Panel 1 Marginal effect of fragmentation on DEVELOPMENT spending as turnout changes (graphs use the annual data)
clear
use "Data_IndiaAnnual_Stata10.dta"
estimates dir // Check to see if results andevexp aneducat anciviladm are in the director.  If so, proceed below. If not, re-estimate Model 7 - 9 in Table 2 above and save results

estimates restore andevexp
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6: Panel 2 Marginal effect of fragmentation on EDUCATION spending as turnout changes (graphs use the annual data)
estimates restore aneducat
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6 Panel 3: Marginal effect of fragmentation on CIVIL ADMINISTRATION spending as turnout changes
estimates restore anciviladm
#delimit ;
generate MV=((_n-1)/1);
replace  MV=. if _n>100;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b1+b3*MV if _n<100;
gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<100; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=20&MV<=85, clwidth(medium) clcolor(black))  (line upper  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=20&MV<=85, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of the Effective Number of Parties) xtitle(Voter Turnout) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6 Panel 4: Marginal effect of turnout on DEVELOPMENT spending as turnout changes
estimates restore andevexp
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6 Panel 5: Marginal effect of turnout on EDUCATION spending as turnout changes
estimates restore aneducat
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr

// Figure 6 Panel 6: Marginal effect of turnout on CIVIL ADMINISTRATION spending as turnout changes
estimates restore anciviladm
#delimit ;
generate MV=((_n-1)/10);
replace  MV=. if _n>80;
matrix b=e(b); 
matrix V=e(V);
scalar b1=b[1,1]; 
scalar b2=b[1,2];
scalar b3=b[1,3];
scalar varb1=V[1,1]; 
scalar varb2=V[2,2]; 
scalar varb3=V[3,3];
scalar covb1b3=V[1,3]; 
scalar covb2b3=V[2,3];
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3;
gen conb=b2+b3*MV if _n<80;
gen conse=sqrt(varb2+varb3*(MV^2)+2*covb2b3*MV) if _n<80; 
gen a=1.65*conse;
gen upper=conb+a;
gen lower=conb-a;
graph twoway (line conb   MV if MV>=1&MV<=7.5 , clwidth(medium) clcolor(black))  (line upper  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black))  (line lower  MV if MV>=1&MV<=7.5, clpattern(dash) clwidth(medium) clcolor(black)), ytitle(Effect of Voter Turnout) xtitle(Effective Number of Parties) legend(off) yline(0, lcolor(black))  graphregion(color(white));
drop MV conb conse a upper lower; 
#delimit cr


*******************************************
*******************************************
*******************************************// END REPLICATION
*******************************************
*******************************************
